<script type="text/javascript">

  function validate(obj)
  {
    if(obj.uname.value == "")
    {
      alert("Name should not be blank");
      obj.uname.focus();
      return false;
    }
    if(obj.uname.value.length <= 6)
    {
      alert("Name should not be lesss then 6 char");
      obj.uname.focus();
      return false;
    }

  }
</script>

<form name="register" onSubmit="return validate(this)" method="get">

  <input type="text" value="" name="email"
  placeholder="Email"/>

  <input type="text" value="" id="unameId" name="uname"
  placeholder="Username"/>

  <input type="text" value="" name="password"
  placeholder="Password"/>

  <input type="submit" />
</form>

